package com.mvc4g.example.shareModel.client.action;

import com.mvc4g.client.ActionInterface;
import com.mvc4g.client.Controller;
import com.mvc4g.example.shareModel.client.Constants;
import com.mvc4g.example.shareModel.client.bean.BeanA;
import com.mvc4g.example.shareModel.client.view.templates.RootTemplate;
import com.mvc4g.example.shareModel.client.view.views.ViewA;

public class ShowAAction implements ActionInterface, Constants {

	@Override
	public void execute(Controller controller, Object form) {
		BeanA modelA = new BeanA();
		modelA.setInfo("A has information needed by B");
		
		ViewA viewA = (ViewA) controller.getView(VIEW_A);
		viewA.setModelA(modelA);
		
		RootTemplate rootView = (RootTemplate) controller.getView(ROOT_TEMPLATE);
		rootView.changeWidgetA(viewA);

	}

}
